home *** CD-ROM | disk | FTP | other *** search
/ Java Primer Plus / Java Primer Plus (Waite Group Proess)(1996).iso / chapter11 / debug.java < prev    next >
Text File  |  1995-12-31  |  450b  |  30 lines

  1. /* Just made for debugging */
  2.  
  3. class righttriangle {
  4.  
  5.     private float height,width,hypot;
  6.  
  7.     public righttriangle(float h,float w) {
  8.     
  9.        height = h;
  10.        width = w;
  11.        hypot = (float)Math.sqrt(w*w + h*h);
  12.     }
  13.  
  14.     public float hypotenuse() {
  15.        return hypot;
  16.        }
  17.     }
  18.  
  19. class debug {
  20.  
  21.     public static void main (String args[]) {
  22.     
  23.      righttriangle T = new righttriangle(3F,4F);
  24.  
  25.      System.out.println(T.hypotenuse());
  26.  
  27.      }
  28.     } 
  29.  
  30.